/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: wx
 * Date: 2023-07-28
 * Time: 9:25
 */
public class Test {
    public  static void print(int n) {
        if(n<10) {
            System.out.println(n%10);
        }
        print(n / 10);
        System.out.println(n%10);
    }

    public static void sum (int n) {
        if(n<10) {
            System.out.println(n);
        }
        sum (n / 10);
        System.out.println(((n % 10) + (n / 10)));
    }
    public static void main(String[] args) {
        print(123);
        sum(123);
    }
}

